Repository navigation
Design: confirming the design is one answer, one refresh, with a busy state - #293
Merged
Merged
Conversation
… state Owner bug on the v0.5.2 notebook (12 November 2026): *Looks right: confirm the design* seemed to do nothing, or was very slow. Cause: the click saved the answers twice and refreshed every page three times; each refresh rebuilt one image-type row per folder (the Channels page) and every replicate box of Check and save, twice. The cost grew with the number of folders (headless: 1.0 s for 36 images, 5.3 s for 384, 7.7 s for 900; about 2,400 to 14,500 widgets sent to the page per click). - The IDs and the "no comparison" answers are saved as one answer (each ID is still tried on its own first, so every refusal is listed; all or none). - ImageTypeRows and the replicate boxes are rebuilt only when what they show changed (folders, saved types and notes, pictures, reopen statuses, views). - The button is disabled and says "Confirming the design..." with a working line before any work; the click ends with the result or the reason; an unexpected failure is a red card naming the error, with the traceback in Technical details, and the button is given back. - The replicate boxes move to notebook_replicates.py (600-line module rule). After: 0.14 s, 0.29 s, 0.46 s; about 250 to 450 widgets. Nothing recorded changed: the same answers are saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
Contributor
Author
|
Tests: 🤖 Generated with Claude Code https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a Generated by Claude Code |
…confirmed The replicate boxes are now kept when nothing they show changed. A "same way" click whose answer was refused changes nothing in the answers, so the clicked toggle stayed on "confirmed" although nothing was saved (on main the rebuild reset it). Drop the kept boxes when the answer is not taken. Regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Owner bug on the v0.5.2 notebook (12 November 2026): Looks right: confirm the design seemed to do nothing, or was very slow.
Cause (cProfile on synthetic experiments): the click saved the answers twice (
_confirm_ids, then the "no comparison" answers) and called_refresh_descriptionthree times. Each refresh rebuilt one image-type row per folder on the Channels page (ImageTypeRows, about 60 % of the time) and every replicate box of Check and save twice, so the cost grew with the number of folders. #292 fixed a different path, the axes confirmation.By module:
notebook_design_step.py: the IDs and the "no comparison" answers are now one answer, saved once and refreshed once._design_clickeddisables the button, changes it to "Confirming the design…" (spinner) and shows a working line before any work. It ends with the green result or the reason for a refusal. An unexpected exception becomes a red card naming the error, with the traceback in Technical details, and the button is given back. A click on a disabled button does nothing.notebook_description.py:_adopt_idsstill tries each ID on its own, so every refusal is listed, all or none, as before. It then saves the given answers once.notebook_channels_type.py:ImageTypeRows.refreshrebuilds its rows only when what they show changes: the folders, each saved type and note, the pictures and the reopen statuses. Cells replaced byImageTypeColumn.openare never kept.notebook_replicates.py(new,uilayer): the replicate boxes moved here fromnotebook_check_save.pyto stay within the 600-line module rule. They are rebuilt only when their views, pictures, channel types, counts, statuses or published dates change.Timing (headless, same machine, click only)
In a real kernel each widget is also sent to the browser, so on Colab the before times are longer than these headless figures.
Screenshots
Headless Chrome render of the Design card (
embed_minimal_html). There are no JupyterLab styles and no Font Awesome icons, so the spinner icon is not drawn.Decisions
Notes for review
_rowand_replicate_boxread.tests/test_notebook_row_fold.pynow patchesnotebook_replicates.replicates, because the function moved there.Tests
New
tests/test_notebook_design_confirm_speed.py(5 tests, on a 64-image fixture):_answerand one_refresh_descriptionper click;ImageTypeRows._build_rowscall;All 5 fail on
main.python tools/check.py(ruff, format, code rules, pytest): see the CI result and the comment below.Generated by Claude Code